package com.laotou99.test1;

import java.awt.image.DataBufferUShort;
import java.util.Date;

public class MainTest1 {
	
	public MainTest1(){}

	public static void main(String[] args) { 
		System.out.println("start");
		MainTest1 mt1 = new MainTest1();
		Date d1 = new Date();
		String str1 = mt1.calculateHash(0, 
				"aaaaaabbbbbbbccccccccc", 
				System.currentTimeMillis(), 
				d1.toLocaleString(), 
				01010101l);
		System.out.println(str1);
	}

	private String calculateHash(int index, String previousHash, long timestamp, String data,long nonce) {
        StringBuilder builder = new StringBuilder(index);
        builder.append(previousHash).append(timestamp).append(data).append(nonce);
        return CryptoUtil.getSHA256(builder.toString());
    }
}
